package com.example.demo.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.entity.Food;
import com.example.demo.entity.Order_Details;
import com.example.demo.entity.Order_Main;
import com.example.demo.mapper.Order_Main_Mapper;
import com.example.demo.service.Order_Main_Service;
import com.example.demo.utils.Searchinfo;
@Service
public class Order_Main_ServiceImpl extends  Basic_serviceimpl<Order_Main> implements Order_Main_Service {
//	@Override
//	public List<Order_Main> select(Searchinfo info) {
//		if(info.getWhere()!=null&&info.getWhere().length()>0) {
//			
//		}else {
//		String where="";
//		if(info.getSearch()!=null&&info.getSearch().length()>0) {
//			where =" where Order_Main.name like '%"+info.getSearch()+"%' ";
//		}
//		info.setWhere(where);
//		}
//		return super.select(info);
//		}

         @Autowired 
          Order_Main_Mapper mapper;
	
         
         public List<Order_Main> select(Searchinfo info) {
     		
     		String where=" where Order_Main.status ="+info.getSearch()+" ";
     	
     		info.setWhere(where);
     		
     		return super.select(info);
     		}
	public void insertdetails(Order_Details t) {
		mapper.insertdetails(t);
		
	}
	
	public void updatedetails(Order_Details t) {
		//mapper.update(t);
		mapper.updatedetails(t);
	}

	@Override
	public void updatedetailsByOrder(Order_Details t) {
		// TODO Auto-generated method stub
		mapper.updatedetailsByOrder(t);
	}

	@Override
	public List<Order_Details> selectdetails(int order_id) {
		// TODO Auto-generated method stub
		return mapper.selectdetails(order_id);
	}

	@Override
	public Order_Details getDetailsById(int id) {
		// TODO Auto-generated method stub
		return mapper.getDetailsById(id);
	}
	@Override
	public List<Food> getFoodByType(Food f) {
		// TODO Auto-generated method stub
		return mapper.getFoodByType(f);
	}
	@Override
	public List<Order_Details> getFoodBystatus(Order_Details d) {
		// TODO Auto-generated method stub
		return mapper.getFoodBystatus(d);
	}
	}

